import { Application } from 'egg';

export default (app: Application) => {
    const { STRING, CHAR } = app.Sequelize;
    const model = app.model.define('Admin', {
        admin_id: { type: CHAR(32), primaryKey: true },//主键
        admin_username: STRING(32),//账号
        admin_password: STRING(32),//密码
        admin_token: STRING(32),//token
        admin_phone: STRING(15),//手机号
        admin_remark: STRING(50),//备注
        admin_status: CHAR(1),//状态（1：启用，2：停用）
        created_by: CHAR(32),//创建人
        updated_by: CHAR(32),//更新人
        is_delete: CHAR(1),//标识是否删除（0：否，1：是）
    }, { tableName: 't_admin' });
    return model;
};

export class Admin {
    admin_id: string;
    admin_username: string;
    admin_password: string;
    admin_token: string;
    admin_phone:string;
    admin_remark: string;
    admin_status: string;
    created_by: string;
    updated_by: string;
    is_delete: string;
}
